


#ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_OHOS_DEVICE_INFO_H_
#define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_OHOS_DEVICE_INFO_H_

#include "modules/video_capture/device_info_impl.h"
#include "modules/video_capture/video_capture_impl.h"

#include <ohcamera/camera.h>
#include <ohcamera/camera_manager.h>
#include <ohcamera/camera_device.h>

namespace webrtc {
namespace videocapturemodule {

class DeviceInfoOhos : public DeviceInfoImpl {
public:
  // Factory function.
  static DeviceInfoOhos* Create();

  DeviceInfoOhos();
  ~DeviceInfoOhos() override;

  int32_t Init() override;
  uint32_t NumberOfDevices() override;

  /*
   * Returns the available capture devices.
   */
  int32_t GetDeviceName(uint32_t deviceNumber,
                        char* deviceNameUTF8,
                        uint32_t deviceNameLength,
                        char* deviceUniqueIdUTF8,
                        uint32_t deviceUniqueIdUTF8Length,
                        char* productUniqueIdUTF8,
                        uint32_t productUniqueIdUTF8Length) override;

  int32_t GetOrientation(const char* deviceUniqueIdUTF8,
                         VideoRotation& orientation) override;
  /*
   * Display OS /capture device specific settings dialog
   */
  int32_t DisplayCaptureSettingsDialogBox(const char* deviceUniqueIdUTF8,
                                          const char* dialogTitleUTF8,
                                          void* parentWindow,
                                          uint32_t positionX,
                                          uint32_t positionY) override;

 protected:
  int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8) override
      RTC_EXCLUSIVE_LOCKS_REQUIRED(_apiLock);

private:
  Camera_Manager* camera_manager_ = nullptr;
  Camera_Device* cameras_ {nullptr};
  uint32_t cameras_size_ {0};
};

}  // namespace videocapturemodule
}  // namespace webrtc
#endif  // MODULES_VIDEO_CAPTURE_MAIN_SOURCE_OHOS_DEVICE_INFO_H_